package com.example.weather.girl

import android.view.View
import androidx.appcompat.widget.AppCompatCheckBox
import com.example.library_base.base.BaseEventHandler
import com.google.android.material.snackbar.Snackbar
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ViewModelComponent
import javax.inject.Inject

@Module
@InstallIn(ViewModelComponent::class)
class GirlEventHandler @Inject constructor(): BaseEventHandler() {

    //点击adapter的Item事件
    fun onItemClick(view: View, girlModel: GirlModel){
        Snackbar.make(view, girlModel.imgurl, Snackbar.LENGTH_LONG).setAction("Action", null).show()
        girlModel.des = "哈哈，美女的图片来啦！"
    }

    //点击Item中的子View事件
    fun onChildItemClick(view: View, girlModel: GirlModel){
        Snackbar.make(view, "点击了子View", Snackbar.LENGTH_LONG).setAction("Action", null).show()
    }

    //点击Item中的子View事件
    fun onItemCheck(view: AppCompatCheckBox, girlModel: GirlModel){
        girlModel.icCheck = !girlModel.icCheck
    }
}